import { RpcCallRes, RpcHandler, RpcHandlerProxy } from "kilom";
import { SvrType } from "../../../config/SvrCfg";

export default class RpcConnector extends RpcHandler {

    kick(uid: number): RpcCallRes<boolean> {
        let sess = this.app.getClient(uid);
        if (sess) {
            console.log("kick");
            sess.kick();
            return { data: true };
        }
        return { data: false };
    }

}

declare global {
    interface Rpc {
        [SvrType.connector]: IRpcConnector
    }

    interface IRpcConnector {
        main: RpcHandlerProxy<RpcConnector>
    }
}